Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correctly transform control file version number in sql entity graph #409

Merged

Conversation

JamesGuthrie
Copy link
Contributor

Commit f00c335 added the ability to use '@CARGO_VERSION@' as a
placeholder for 'default_version' in the extension's .control file.

That change missed the fact that the contents of the .control file are
loaded into the root node of the sql entity graph. This means that when
using the placeholder, the default_version in the sql entity graph's
control file is '@CARGO_VERSION@'.

This change replaces the placeholder with the package version when
executing the compiled sql-generator.

@Hoverbear
Copy link
Contributor

Oh!!! Good catch!

@JamesGuthrie JamesGuthrie force-pushed the jg/fix-version-sql-tree branch from a48b2e8 to 624a1b3 Compare January 31, 2022 07:17
Commit f00c335 added the ability to use '@CARGO_VERSION@' as a
placeholder for 'default_version' in the extension's .control file.

That change missed the fact that the contents of the .control file are
loaded into the root node of the sql entity graph. This means that when
using the placeholder, the default_version in the sql entity graph's
control file is '@CARGO_VERSION@'.

This change compiles the package version into the sql-generator, which
performs the replacement at runtime.
@JamesGuthrie JamesGuthrie force-pushed the jg/fix-version-sql-tree branch from 624a1b3 to 52b80ab Compare January 31, 2022 07:21
@JamesGuthrie
Copy link
Contributor Author

@Hoverbear as discussed on Discord, I've updated this PR to compile the CARGO_PKG_VERSION into the sql-generator binary, and use that to replace @CARGO_VERSION@ with.

@Hoverbear Hoverbear merged commit 3af19b6 into pgcentralfoundation:develop Jan 31, 2022
@Hoverbear
Copy link
Contributor

Thanks for this!

@JamesGuthrie JamesGuthrie deleted the jg/fix-version-sql-tree branch February 1, 2022 07:42
@Hoverbear Hoverbear mentioned this pull request Feb 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants